home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / libx11 / include / x11 / xdmcp.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  4KB  |  142 lines

  1. /* $XConsortium: Xdmcp.h,v 1.8 91/07/23 22:28:07 keith Exp $ */
  2. /*
  3.  * Copyright 1989 Network Computing Devices, Inc., Mountain View, California.
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software and its
  6.  * documentation for any purpose and without fee is hereby granted, provided
  7.  * that the above copyright notice appear in all copies and that both that
  8.  * copyright notice and this permission notice appear in supporting
  9.  * documentation, and that the name of N.C.D. not be used in advertising or
  10.  * publicity pertaining to distribution of the software without specific,
  11.  * written prior permission.  N.C.D. makes no representations about the
  12.  * suitability of this software for any purpose.  It is provided "as is"
  13.  * without express or implied warranty.
  14.  *
  15.  */
  16.  
  17. #ifndef _XDMCP_H_
  18. #define _XDMCP_H_
  19. #define XDM_PROTOCOL_VERSION    1
  20. #define XDM_UDP_PORT        177
  21. #define XDM_MAX_MSGLEN        8192
  22. #define XDM_MIN_RTX        2
  23. #define XDM_MAX_RTX        32
  24. #define XDM_RTX_LIMIT        7
  25. #define XDM_KA_RTX_LIMIT    4
  26. #define XDM_DEF_DORMANCY    (3 * 60)    /* 3 minutes */
  27. #define XDM_MAX_DORMANCY    (24 * 60 * 60)    /* 24 hours */
  28.  
  29. typedef enum {
  30.     BROADCAST_QUERY = 1, QUERY, INDIRECT_QUERY, FORWARD_QUERY,
  31.     WILLING, UNWILLING, REQUEST, ACCEPT, DECLINE, MANAGE, REFUSE, 
  32.     FAILED, KEEPALIVE, ALIVE 
  33. } xdmOpCode;
  34.  
  35. typedef enum {
  36.     XDM_QUERY, XDM_BROADCAST, XDM_INDIRECT, XDM_COLLECT_QUERY,
  37.     XDM_COLLECT_BROADCAST_QUERY, XDM_COLLECT_INDIRECT_QUERY,
  38.     XDM_START_CONNECTION, XDM_AWAIT_REQUEST_RESPONSE,
  39.     XDM_AWAIT_MANAGE_RESPONSE, XDM_MANAGE, XDM_RUN_SESSION, XDM_OFF,
  40.     XDM_AWAIT_USER_INPUT, XDM_KEEPALIVE, XDM_AWAIT_ALIVE_RESPONSE
  41. } xdmcp_states;
  42.  
  43. #ifdef NOTDEF
  44. /* table of hosts */
  45.  
  46. #define XDM_MAX_STR_LEN 21
  47. #define XDM_MAX_HOSTS 20
  48. struct xdm_host_table {
  49.   struct sockaddr_in sockaddr;
  50.   char name[XDM_MAX_STR_LEN];
  51.   char status[XDM_MAX_STR_LEN];
  52. };
  53. #endif /* NOTDEF */
  54.  
  55. typedef CARD8    *CARD8Ptr;
  56. typedef CARD16    *CARD16Ptr;
  57. typedef CARD32    *CARD32Ptr;
  58.  
  59. typedef struct _ARRAY8 {
  60.     CARD16    length;
  61.     CARD8Ptr    data;
  62. } ARRAY8, *ARRAY8Ptr;
  63.  
  64. typedef struct _ARRAY16 {
  65.     CARD8    length;
  66.     CARD16Ptr    data;
  67. } ARRAY16, *ARRAY16Ptr;
  68.  
  69. typedef struct _ARRAY32 {
  70.     CARD8    length;
  71.     CARD32Ptr    data;
  72. } ARRAY32, *ARRAY32Ptr;
  73.  
  74. typedef struct _ARRAYofARRAY8 {
  75.     CARD8    length;
  76.     ARRAY8Ptr    data;
  77. } ARRAYofARRAY8, *ARRAYofARRAY8Ptr;
  78.  
  79. typedef struct _XdmcpHeader {
  80.     CARD16  version, opcode, length;
  81. } XdmcpHeader, *XdmcpHeaderPtr;
  82.  
  83. typedef struct _XdmcpBuffer {
  84.     BYTE    *data;
  85.     int        size;        /* size of buffer pointed by to data */
  86.     int        pointer;        /* current index into data */
  87.     int        count;        /* bytes read from network into data */
  88. } XdmcpBuffer, *XdmcpBufferPtr;
  89.  
  90. typedef struct _XdmAuthKey {
  91.     BYTE    data[8];
  92. } XdmAuthKeyRec, *XdmAuthKeyPtr;
  93.  
  94.  
  95. /* implementation-independent network address structure.
  96.    Equiv to sockaddr* for sockets and netbuf* for STREAMS. */
  97.  
  98. typedef char *XdmcpNetaddr;
  99.  
  100.  
  101. extern int XdmcpWriteCARD8(),        XdmcpWriteCARD16();
  102. extern int XdmcpWriteCARD32();
  103. extern int XdmcpWriteARRAY8(),        XdmcpWriteARRAY16();
  104. extern int XdmcpWriteARRAY32(),        XdmcpWriteARRAYofARRAY8();
  105. extern int XdmcpWriteHeader(),        XdmcpFlush();
  106.  
  107. extern int XdmcpReadCARD8(),        XdmcpReadCARD16();
  108. extern int XdmcpReadCARD32();
  109. extern int XdmcpReadARRAY8(),        XdmcpReadARRAY16();
  110. extern int XdmcpReadARRAY32(),        XdmcpReadARRAYofARRAY8();
  111. extern int XdmcpReadHeader(),        XdmcpFill();
  112.  
  113. extern int  XdmcpReadRemaining();
  114.  
  115. extern void XdmcpDisposeARRAY8(),    XdmcpDisposeARRAY16();
  116. extern void XdmcpDisposeARRAY32(),    XdmcpDisposeARRAYofARRAY8();
  117.  
  118. extern int XdmcpCopyARRAY8();
  119.  
  120. extern int XdmcpARRAY8Equal();
  121.  
  122. #ifdef HASXDMAUTH
  123. extern void XdmcpGenerateKey();
  124. extern void XdmcpIncrementKey();
  125. extern void XdmcpDecrementKey();
  126. extern void XdmcpWrap();
  127. extern void XdmcpUnwrap();
  128. #endif
  129.  
  130. #ifndef TRUE
  131. #define TRUE    1
  132. #define FALSE    0
  133. #endif
  134.  
  135. #ifndef Xalloc
  136. #ifndef xalloc
  137. extern long *Xalloc (), *Xrealloc ();
  138. extern void Xfree();
  139. #endif
  140. #endif
  141. #endif /* _XDMCP_H_ */
  142.